#pragma once
#include "HSModelApi.h"
#include "GeometryUtils.h"

#include <memory>

class World;
class GameController;
class WorldObject;
class Model3D;
class Water;

/**
* Class for updating world
*/
class WorldUpdater
  {
  public:
    HSMODEL_API WorldUpdater(World& i_world, GameController &i_game_controller);

    HSMODEL_API void CreateHill(TVector2 i_point);
    HSMODEL_API void CreateHole(TVector2 i_point);
    HSMODEL_API void CreateWalkway(TVector2 i_point);
    HSMODEL_API void AddGrass(TVector2 i_point);
    HSMODEL_API void CreateWater(std::shared_ptr<Water> ip_water_model);
    HSMODEL_API void AddTree(const TVector3& i_position);
    HSMODEL_API void AddFerrisWheel(const TVector3& i_position);
    HSMODEL_API void AddBalloonsShop(const TVector3& i_position);
    HSMODEL_API void AddBench(TVector2 i_point);
    HSMODEL_API void DestroyObject(const TVector2& i_position);
    HSMODEL_API void RemoveWater(size_t index);
    HSMODEL_API bool MoveObjects(int i_timer_id = -1);
    HSMODEL_API bool MakeProfit(int i_timer_id = -1);
    HSMODEL_API bool ProcessAnimations(int i_timer_id = -1);
  private:
    void _MoveObject(WorldObject* ip_object, const TVector3& i_new_position);
    void _ChangeHumanCount(size_t i_new_human_count);

    void _AddHumans(size_t i_number);
    void _RemoveHumans(size_t i_number);

  private:
    World& m_world;
    GameController& m_game_controller;
  };
